<?php
$reserv_id=$_REQUEST['var'];
$loc_id=$_REQUEST['loc'];

include("connection/connection.php");
if(isset($_REQUEST['loc_id']))
{
$qr="delete from tbl_dtls_q1_reserv where id='$_REQUEST[reserv_id]'";
$res=mysql_query($qr);
echo mysql_error();
if($res)
{
if($_REQUEST['code']==1) $update_query="update tbl_dtls_q1_main set cwr_total=(cwr_total-1) where id='$_REQUEST[loc_id]'";
else if($_REQUEST['code']==2) $update_query="update tbl_dtls_q1_main set glsr_total=(glsr_total-1) where id='$_REQUEST[loc_id]'";
else if($_REQUEST['code']==3) $update_query="update tbl_dtls_q1_main set glr_total=(glr_total-1) where id='$_REQUEST[loc_id]'";
else $update_query="update tbl_dtls_q1_main set ohsr_total=(ohsr_total-1) where id='$_REQUEST[loc_id]'";

$res1=mysql_query($update_query);
if($res1)
{
header("location:q1_rwss_edit.php");
}
}

}		
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="javascript">
function abc()
{
window.close();
}
</script> 
</head>

<body>
<form  action="reservrwss_delete_view.php" method="post">
<input type="hidden" name="reserv_id" value="<?php echo $reserv_id;?>" />
<input type="hidden" name="loc_id" value="<?php echo $loc_id;?>" />
<input type="hidden" name="code" value="<?php echo $_REQUEST['code']; ?>" />

<font face="Verdana, Arial, Helvetica, sans-serif" style="font-size:12px" color="#333333"><b>Are you sure to delete this asset?</b></font><br /><br />
<input type="submit" name="delete" id="delete" value="YES" style="background-color:#666666; font-size:10px; color:#FFFFFF; border:2px solid #CCCCCC; height:25px; width:50px" />&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" name="cancel" id="cancel" onclick="window.close();" value="NO" style="background-color:#666666; font-size:10px; color:#FFFFFF; border:2px solid #CCCCCC;height:25px; width:50px"/>
</form>
</body>
</html>
